/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package firstround2009;

import java.io.IOException;
import static chanlib.Chan_IO.*;

/**
 * @author robit
 */
public class BrideThePrisoner{
    /*
      All neccesary to be defined
      including:
      variable, inner class
    */
    // static int A;
    // static void B();
    // static class C

    /*
       One calculation fits all of the cases.
    */
    static int room[];
    static int minBribe[][];
    static void preReckon(){
        return;
    }
    static int minBribe(int head, int tail){
        if(minBribe[head][tail]>=0)return minBribe[head][tail];
        if(tail==head+1)return minBribe[head][tail]=0;
        int min=Integer.MAX_VALUE;
        for(int p=head+1;p<tail;p++){
            int left=room[p]-room[head]-1+minBribe(head, p);
            int right=room[tail]-room[p]-1+minBribe(p,tail);
            min=Math.min(min,left+right);
        }
        return minBribe[head][tail]=min;
    }
    /*
      calculate the answer
    */
    private static void reckon(int line) {
        int P=Int();
        int Q=Int();
        room=new int[Q+2];
        room[0]=0;room[Q+1]=P+1;
        for(int i=1;i<=Q;i++){
            room[i]=Int();
        }
        minBribe=new int[Q+1][Q+2];
        for(int i=0;i<=Q;i++)
        for(int j=0;j<=Q+1;j++)
        {
            minBribe[i][j]=-1;
        }

        int ans = minBribe(0, Q+1);

        String output=String.format("Case #%d: %d",line,ans);
        writeln(output, OUTFILE);
        //writeln(String.format("N=%d K=%d\n%s", N, K, ans),ANALFILE);
        //println(output);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        /*
           Pre-computing for all cases
        */

        // Just in case!
        //preReckon();
        //while((char)read()!='P');

        /*
          Input-output
        */
        boolean test=false;
        boolean small=false;
        String prob="C";
        String filename;
        if(test) filename="test";
        else{
            if(small) filename=prob+"-small-practice";
            else filename=prob+"-large-practice";
        }
        try {
            /*
               Init IO,plus determination of input line number
             */
            int lineNums = initFileIO(filename);
            for (int i = 1; i <= lineNums; i++) {
                reckon(i);
            }
        } finally {
            endIO();
        }
    }

}
